package plus.logic;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.additional.query.impl.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.additional.query.impl.QueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.additional.update.impl.LambdaUpdateChainWrapper;
import com.baomidou.mybatisplus.extension.service.additional.update.impl.UpdateChainWrapper;
import org.springframework.beans.factory.annotation.Autowired;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.function.Function;

public class LogicBaseServiceImpl<M extends LogicBaseDao<T>,T>  implements LogicBaseService<T>{

	@Autowired
	protected M logicBaseDao;

	@Override
	public M getLogicBaseDao() {
		return logicBaseDao;
	}
	
	@Override
	public boolean save(T entity) {
		return logicBaseDao.save(entity);
	}

	@Override
	public boolean saveBatch(Collection<T> entityList) {
		return logicBaseDao.saveBatch(entityList);
	}

	@Override
	public boolean saveBatch(Collection<T> entityList, int batchSize) {
		return logicBaseDao.saveBatch(entityList, batchSize);
	}

	@Override
	public boolean saveOrUpdateBatch(Collection<T> entityList) {
		return logicBaseDao.saveOrUpdateBatch(entityList);
	}

	@Override
	public boolean saveOrUpdateBatch(Collection<T> entityList, int batchSize) {
		return logicBaseDao.saveOrUpdateBatch(entityList, batchSize);
	}

	@Override
	public boolean removeById(Serializable id) {
		return logicBaseDao.removeById(id);
	}

	@Override
	public boolean removeByMap(Map<String, Object> columnMap) {
		return logicBaseDao.removeByMap(columnMap);
	}

	@Override
	public boolean remove(Wrapper<T> queryWrapper) {
		return logicBaseDao.remove(queryWrapper);
	}

	@Override
	public boolean removeByIds(Collection<? extends Serializable> idList) {
		return logicBaseDao.removeByIds(idList);
	}

	@Override
	public boolean updateById(T entity) {
		return logicBaseDao.updateById(entity);
	}

	@Override
	public boolean update(T entity, Wrapper<T> updateWrapper) {
		return logicBaseDao.update(entity,updateWrapper);
	}

	@Override
	public boolean update(Wrapper<T> updateWrapper) {
		return logicBaseDao.update(updateWrapper);
	}

	@Override
	public boolean updateBatchById(Collection<T> entityList) {
		return logicBaseDao.updateBatchById(entityList);
	}

	@Override
	public boolean updateBatchById(Collection<T> entityList, int batchSize) {
		return logicBaseDao.updateBatchById(entityList, batchSize);
	}

	@Override
	public boolean saveOrUpdate(T entity) {
		return logicBaseDao.saveOrUpdate(entity);
	}

	@Override
	public T getById(Serializable id) {
		return logicBaseDao.getById(id);
	}

	@Override
	public Collection<T> listByIds(Collection<? extends Serializable> idList) {
		return logicBaseDao.listByIds(idList);
	}

	@Override
	public Collection<T> listByMap(Map<String, Object> columnMap) {
		return logicBaseDao.listByMap(columnMap);
	}

	@Override
	public T getOne(Wrapper<T> queryWrapper) {
		return logicBaseDao.getOne(queryWrapper);
	}

	@Override
	public T getOne(Wrapper<T> queryWrapper, boolean throwEx) {
		return logicBaseDao.getOne(queryWrapper, throwEx);
	}

	@Override
	public Map<String, Object> getMap(Wrapper<T> queryWrapper) {
		return logicBaseDao.getMap(queryWrapper);
	}

	@Override
	public <V> V getObj(Wrapper<T> queryWrapper, Function<? super Object, V> mapper) {
		return logicBaseDao.getObj(queryWrapper, mapper);
	}

	@Override
	public int count(Wrapper<T> queryWrapper) {
		return logicBaseDao.count(queryWrapper);
	}

	@Override
	public int count() {
		return logicBaseDao.count();
	}

	@Override
	public List<T> list(Wrapper<T> queryWrapper) {
		return logicBaseDao.list(queryWrapper);
	}

	@Override
	public List<T> list() {
		return logicBaseDao.list();
	}

	@Override
	public IPage<T> page(IPage<T> page, Wrapper<T> queryWrapper) {
		return logicBaseDao.page(page, queryWrapper);
	}

	@Override
	public IPage<T> page(IPage<T> page) {
		return logicBaseDao.page(page);
	}

	@Override
	public List<Map<String, Object>> listMaps(Wrapper<T> queryWrapper) {
		return logicBaseDao.listMaps(queryWrapper);
	}

	@Override
	public List<Map<String, Object>> listMaps() {
		return logicBaseDao.listMaps();
	}

	@Override
	public List<Object> listObjs() {
		return logicBaseDao.listObjs();
	}

	@Override
	public <V> List<V> listObjs(Function<? super Object, V> mapper) {
		return logicBaseDao.listObjs(mapper);
	}

	@Override
	public List<Object> listObjs(Wrapper<T> queryWrapper) {
		return logicBaseDao.listObjs(queryWrapper);
	}

	@Override
	public <V> List<V> listObjs(Wrapper<T> queryWrapper, Function<? super Object, V> mapper) {
		return logicBaseDao.listObjs(queryWrapper, mapper);
	}

	@Override
	public IPage<Map<String, Object>> pageMaps(IPage<T> page, Wrapper<T> queryWrapper) {
		return logicBaseDao.pageMaps(page, queryWrapper);
	}

	@Override
	public IPage<Map<String, Object>> pageMaps(IPage<T> page) {
		return logicBaseDao.pageMaps(page);
	}


	@Override
	public QueryChainWrapper<T> query() {
		return logicBaseDao.query();
	}

	@Override
	public LambdaQueryChainWrapper<T> lambdaQuery() {
		return logicBaseDao.lambdaQuery();
	}

	@Override
	public UpdateChainWrapper<T> update() {
		return logicBaseDao.update();
	}

	@Override
	public LambdaUpdateChainWrapper<T> lambdaUpdate() {
		return logicBaseDao.lambdaUpdate();
	}

	@Override
	public boolean saveOrUpdate(T entity, Wrapper<T> updateWrapper) {
		return logicBaseDao.saveOrUpdate(entity, updateWrapper);
	}
	
	
}
